<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="dominio.Articulo"%>
<%@page language="java" import="java.util.*"%>
<h1>Lista de Articulos</h1>
<form id="aumentarStockID" method="post" class="form-inline" role="form">
	<div class="table-responsive">
		<table class="table table-bordered table-striped">
			<thead>
				<tr>
					<th></th>
					<th>Codigo</th>
					<th>Nombre</th>
					<th>Tipo</th>
					<th>Cantidad</th>
				</tr>
			</thead>
			<tbody>
				<%
					List<Articulo> data = (List<Articulo>) request.getAttribute("data");
					for (Iterator<Articulo> itr = data.iterator(); itr.hasNext();) {
						Articulo articulo = itr.next();
				%>
				<tr>
					<td><input name="seleccionado" type="checkbox"
						value="<%=articulo.getCodigo()%>"></td>
					<td><span><%=articulo.getCodigo()%></span></td>
					<td><span><%=articulo.getNombre()%></span></td>
					<td><span><%=articulo.getTipo()%></span></td>
					<td><span><%=articulo.getCantidad()%></span></td>
				</tr>
				<%}%>
			</tbody>
		</table>
	</div>
	<%if (data.size() > 0 ) { %>
	<div class="form-group">
		<input name="stock" type="text" class="form-control" placeholder="10">
	</div>
	<div class="form-group">
		<div class="col-sm-2 control-label">
			<div class="col-sm-10">
				<button type="submit" class="btn btn-success">Agregar Stock</button>
			</div>
		</div>
	</div>
	<%}%>
</form>
<script type="text/javascript" src="js/tpia.js"></script>